﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PictrueSimpleSyndication
{
    public partial class UserControlPictrues : UserControl
    {
        public UserControlPictrues()
        {
            InitializeComponent();

            label1.BackColor = Color.Transparent;
            label1.Parent = pictureBox1;
        }

        public void InitView(ContentInfo contentinfo)
        {
            label1.Text = contentinfo.Describe;
        }

        public void SetIndexText(string text)
        {
            label_Index.Text = text;
        }

        private void UserControlPictrues_Resize(object sender, EventArgs e)
        {
            label_Index.SetPositionByAnchr(this.GetAnchrPoint(0.5, 0.5), new Anchor(0.5, 0.5));
        }

        public void SetImageLocalPath(string path)
        {
            pictureBox1.ImageLocation = path;
            label_Index.Visible = false;
        }
    }
}
